#encoding: utf-8
class ApplicationController < ActionController::Base
  protect_from_forgery
  
  alias :logged_in? :user_signed_in?
  alias :login_required :authenticate_user!
  
  # def after_sign_in_path_for(resource)
    # desktop_index_path
  # end
  
  def getPhoneNumber(phone_number)
    numbers = phone_number.scan(/\d/) #pn.gsub(" ","")
    numbers = numbers.join(",")
    numbers = numbers.gsub(",","")
    numbers = numbers[3..numbers.length] if numbers[0...3].to_s == "+86"
    numbers = numbers[2..numbers.length] if numbers[0...2].to_s == "86"

    numbers
  end
end
